package org.edu.modules.kwgl.api;

import com.alibaba.fastjson.JSONObject;
import org.edu.common.api.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

//@FeignClient(name = "edu-common", url = "http://172.16.20.55:4010")
@FeignClient(name = "edu-common", url = "http://150.242.97.194:14010")
public interface CommonApi {
    public static final String COMMON_TOKEN_KEY = "09d5e1e7f9b049008eee645c783a1d67";

    //根据学生学号查找学生信息,关键信息，xm，gradeId，bjId，specId，falId，xz，数据直接在result
    @GetMapping("/common/veCommon/queryStudentByUserId")
    Result<JSONObject> queryStudentByUserId(@RequestParam("id") String id, @RequestParam("userId") String userId);

    //根据学生ID查找学生信息,关键信息，xm，gradeId，bjId，specId，falId，xz，数据直接在result
    @GetMapping("/common/veCommon/getStudentById")
    Result<JSONObject> getStudentById(@RequestParam("interfaceUserId") String interfaceUserId, @RequestParam("studentId") Integer studentId);


    //根据老师的工号查找老师的信息，数据直接在result
    @GetMapping("/common/veCommon/queryTeacherByGH")
    Result<JSONObject> queryTeacherByGH(@RequestParam("id") String id,@RequestParam("gh") String gh);


    //根据教师id获取教师信息
    @GetMapping("/common/veCommon/queryTeacherById")
    Result<JSONObject> queryTeacherById(@RequestParam("interfaceUserId") String interfaceUserId,
                                        @RequestParam("teacherId") Integer teacherId);

    //根据userid获取用户信息
    @GetMapping("/common/veCommon/queryAppUserByUserId")
    Result<JSONObject> queryAppUserByUserId(@RequestParam("id") String id,
                                        @RequestParam("userId") String userId);

    //根据老师的工号查找老师的信息，数据直接在result
    @GetMapping("/common/veCommon/getTeacherPageList")
    Result<JSONObject> getTeacherPageList(@RequestParam("interfaceUserId") String interfaceUserId,@RequestParam("gh") String gh);

    //获取所有院系
    @GetMapping("/common/veCommon/queryFacultyList")
    Result<List<JSONObject>> queryFacultyList(@RequestParam("id") String id);

    //获取所有学制
    @GetMapping("/common/veCommon/queryXueZhiList")
    Result<List<JSONObject>> queryXueZhiList(@RequestParam("id") String id);

    //获取所有学期信息
    @GetMapping("/common/veCommon/querySemesterList")
    Result<List<JSONObject>> querySemesterList(@RequestParam("id") String id);

    //获取所有年级
    @GetMapping("/common/veCommon/queryGradeList")
    Result<List<JSONObject>> queryGradeList(@RequestParam("id") String id);

//    获取所有校区信息
    @GetMapping("/common/veCommon/queryCampusList")
    Result<List<JSONObject>> queryCampusList(@RequestParam("id") String id);


    //根据院系id获取所有专业
    @GetMapping("/common/veCommon/querySpecialtyListByFalId")
    Result<List<JSONObject>> querySpecialtyListByFalId(@RequestParam("interfaceUserId") String interfaceUserId,
                                                       @RequestParam("falId") Integer falId);

    //根据专业id获取所有班级
    @GetMapping("/common/veCommon/queryBanJiListBySpecId")
    Result<List<JSONObject>> queryBanJiListBySpecId(@RequestParam("id") String id,
                                        @RequestParam("specId") Integer specId);


    //根据班级名称匹配对应班级
    @GetMapping("/common/veCommon/queryBanJiPageList")
    Result<JSONObject> queryBanJiPageList(@RequestParam("interfaceUserId") String interfaceUserId,
                                                    @RequestParam("xzbmc") String xzbmc);


    //根据学生学号查找学生信息,关键信息，xm，gradeId，bjId，specId，falId，xz，数据直接在result
    @GetMapping("/common/veCommon/getStudentInfoByUserId")
    Result<JSONObject> getStudentInfoByUserId(@RequestParam("interfaceUserId") String id, @RequestParam("userId") String userId);



    //根据学号获取学生
    @GetMapping("/common/veCommon/getStudentPageList")
    Result<JSONObject> getStudentPageList(@RequestParam("interfaceUserId") String interfaceUserId,
                                          @RequestParam(value = "xh" , required = false) String xh,@RequestParam(value = "xm",required = false) String xm);


    //根据班级获取学生
    @GetMapping("/common/veCommon/getStudentPageList")
    Result<JSONObject> getStudentPageList(@RequestParam("interfaceUserId") String interfaceUserId,
                                          @RequestParam(value = "bjId" , required = true) Integer bjId,
                                          @RequestParam(value = "pageSize",required = true) Integer pageSize
    );


    //根据专业id获取专业信息
    @GetMapping("/common/veCommon/querySpecialtyById")
    Result<JSONObject> querySpecialtyById(@RequestParam("interfaceUserId") String interfaceUserId,
                                          @RequestParam("specialtyId") Integer specialtyId);


    //根据班级id获取班级信息
    @GetMapping("/common/veCommon/queryBanJiById")
    Result<JSONObject> queryBanJiById(@RequestParam("interfaceUserId") String interfaceUserId,
                                      @RequestParam("banJiId") Integer banJiId);

}
